<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<script type="text/javascript">
$(document).ready(function(){
	$("select[name='deskCode']").change(function(){
		var deskCode = $(this).find("option:selected").val();
		//alert(deskCode);
		location.href = "/promote/promoteList.desk?deskCode=" + deskCode;
	});
});
</script>
<link rel="stylesheet" type="text/css" href="/css/promote.css"/>
<script type="text/javascript" src="/js/promote.js"></script>

<s:url id="listURLPrev" value="/promote/promoteList.desk">
	<s:param name="pageNumber">
		<s:property value="pageInfoDataMap.pageNumber - 1"/>
	</s:param>
	<s:param name="deskCode">
		<s:property value="deskCode"/>
	</s:param>
</s:url>

<s:url id="listURLNext" value="/promote/promoteList.desk">
	<s:param name="pageNumber">
		<s:property value="pageInfoDataMap.pageNumber + 1"/>
	</s:param>
	<s:param name="deskCode">
		<s:property value="deskCode"/>
	</s:param>
</s:url>

<s:set name="authCode" value="#session.authCode"/>
<s:set name="totalCount" value="%{pageInfoDataMap.totalCount}"/>

<input type="hidden" name="deskCodeForExcel" value="<s:property value="#session.deskCode"/>"/>
<input type="hidden" name="userSeq" value="<s:property value="#session.userSeq"/>"/>
<input type="hidden" name="authCode" value="<s:property value="#session.authCode"/>"/>
<input type="hidden" name="reportGubun" value="promote"/>

<!-- 오른쪽 내용 시작 -->
      <dl class="Right_Contents_area">
        <dd class="Center_Top_title"> <span class="top_title"><img src="/images/report/promote/SubContents_Tit_01.gif" width="370" height="42" alt="홍보 실적" /></span> <span class="top_navi">HOME > 업무보고 > 홍보 실적</span></dd>
        <dd class="Right_Contents_Search"><img src="/images/report/apply/SubContents_Tit_CenterChoice.gif" width="81" height="21" alt="센터선택" /></dd>
         <dd class="Right_Contents_SearchOption">
         <s:if test="%{#authCode == 'ADMIN'}">	
        	<s:include value="/view/include/common/deskcode/deskcode_total.jsp"/>
   		</s:if>
   		<s:if test="%{#authCode != 'ADMIN'}">
   			<span style="font-weight: bold; color: blue;"><s:property value="#session.deskCodeValue"/></span>
   		</s:if>
        </dd>
        <dd class="Right_Contents_Notice">총 <span class="TEXT_Red_Bold"><s:property value="%{#totalCount}"/></span>건의 실적정보 검색됨</dd>
        <dd class="Right_Contents_NoticeBtn"><img src="/images/notice/btn_ExelDown.gif" id="btn_excel_download" width="114" height="26" alt="엑셀다운로드" style="cursor:pointer"/></dd>
        <dd class="Center_Top_contents">
          <div id="LIst_Zone">
            <dl>
              <dd>
                <table cellspacing="0" border="1" summary="글목록" class="Listboard">
                  <caption>글목록</caption>
                  <colgroup><col width="55"><col width="1"><col width="145"><col width="1"><col width="145"><col width="1"><col width="288"><col width="1"><col width="83"></colgroup>
                  <thead>
                    <tr>
                      <th scope="col">번호</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">홍보방법</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">대상</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">내용</th>
                      <th scope="col"><img src="/images/notice/board_line.gif" width="1" height="30" alt="" /></th>
                      <th scope="col">일자</th>
                    </tr>
                  </thead>
                  <tbody>
                  	<s:if test="promoteList.size == 0">
			     		<tr>
							<td colspan="13" style="text-align: center">등록된 기업이 없습니다.</td>
						</tr>
					</s:if>
					<s:else>
						<s:iterator value="promoteList" status="stat">
		                    <tr>
		                      <td><s:property value="(#totalCount + 1 - ((pageInfoDataMap.pageNumber - 1) * pageInfoDataMap.countPerPage)) - (#stat.count)"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td class="tdTit"><a href="/promote/promoteDetail.desk?promoteSeq=<s:property value="promoteSeq"/>"><s:property value="promoteWay"/></a></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td class="tdTit"><s:property value="promoteTarget"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td class="tdTit"><s:property value="promoteContent"/></td>
		                      <td><img src="/images/notice/board_line2.gif" width="1" height="24" alt="" /></td>
		                      <td><s:property value="promoteDate"/></td>
		                    </tr>  
                   	</s:iterator>
                   </s:else>
                  </tbody>
                  <!-- 리스트 부분 -->
                </table>
              </dd>
               
            </dl> 
            <dl class="List_Page_area"><!-- 리스트 페이징 부분 -->
              <dd class="page_area">
                <div class="paginate">
                    <s:if test="pageInfoDataMap.startPage > pageInfoDataMap.pagePerBlock">
						<s:a href="%{listURLPrev}" cssClass="pre">이전페이지</s:a>
					</s:if> 
			      	<c:forEach var="pageNum" begin="${pageInfoDataMap.startPage}" end="${pageInfoDataMap.endPage}">
						<c:choose>
							<c:when test="${pageNum != 0 && pageNum == pageInfoDataMap.pageNumber}">
								${pageNum}
							</c:when>
							<c:when test="${pageNum == 0 }">
							
							</c:when>
							<c:otherwise>
								<a href="<c:url value="/promote/promoteList.desk?pageNumber=${pageNum}&deskCode=${deskCode}"/>"> [${pageNum}] </a>
							</c:otherwise>
						</c:choose>
					</c:forEach>
			      	<s:if test="pageInfoDataMap.endPage < pageInfoDataMap.totalPageCount">
						<s:a href="%{listURLNext}" cssClass="next">다음페이지 </s:a>
					</s:if>
                </div>               
              </dd>            
            </dl><!-- 리스트 페이징 부분 -->
            <dl class="List_Btn_area"><!-- 버튼 부분 -->
             <dd class="Left_Zone"><a href="/promote/promoteList.desk"><img src="/images/notice/btn_list.gif" alt="목록" width="52" height="26" border="0" /></a></dd>
              <s:if test="#authCode != 'ADMIN' && #authCode != 'ADMIN_ORG'">
             	<dd class="Right_Zone"><a href="/promote/promoteForm.desk"><img src="/images/report/promote/btn_write.gif" width="115" height="26" alt="홍보실적 등록" border="0" /></a></dd>
              </s:if>
            </dl><!-- 버튼 부분 -->                   
          </div>
        </dd>
      </dl>
      <!-- 오른쪽 내용 끝 --> 
    </div>
  </div>
  <!-- center 나누어 지는 부분 끝 --> 
</div>